﻿// <copyright file="Platform.cs" company="Microsoft Corporation">
// Copyright (c) 2010 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2010-11-16</date>
// <summary>Platform class definition</summary>

namespace NYTimes.Core
{
    using System.Net;

    /// <summary>
    /// WP7-specific platform methods
    /// </summary>
    public class Platform
    {
        /// <summary>
        /// Prevents a default instance of the Platform class from being created.
        /// </summary>
        private Platform()
        {
        }

        /// <summary>
        /// HTML Decoding
        /// </summary>
        /// <param name="html">Escaped HTML text</param>
        /// <returns>Unescaped HTML text</returns>
        public static string HtmlDecode(string html)
        {
            return HttpUtility.HtmlDecode(html);
        }

        /// <summary>
        /// Convert a text string into a URL-encoded string
        /// </summary>
        /// <param name="url">the text to URL-encode</param>
        /// <returns>a URL Encoded text string</returns>
        public static string UrlEncode(string url)
        {
            return HttpUtility.UrlEncode(url);
        }
    }
}
